<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>管理员登录</title>
    <!-- PACE-->
    <link rel="stylesheet" type="text/css" href="/static/admin/plugins/PACE/themes/blue/pace-theme-flash.css">
    <script type="text/javascript" src="/static/admin/plugins/PACE/pace.min.js"></script>
    <!-- Bootstrap CSS-->
    <link rel="stylesheet" type="text/css" href="/static/admin/plugins/bootstrap/dist/css/bootstrap.min.css">
    <!-- Fonts-->
    <link rel="stylesheet" type="text/css" href="/static/admin/plugins/themify-icons/themify-icons.css">
    <!-- Primary Style-->
    <link rel="stylesheet" type="text/css" href="/static/admin/build/css/umega.css">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries-->
    <!-- WARNING: Respond.js doesn't work if you view the page via file://-->
    <!--[if lt IE 9]>
    <script type="text/javascript" src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script type="text/javascript" src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body class="user-page">
<h1 class="fw-600 mt-0 mb-20">来搭配后台</h1>
<form method="get" id="login" action="" class="form-horizontal" onsubmit="return false;">
    <div class="form-group has-feedback">
        <div class="col-xs-12">
            <input type="text" name="user_name" aria-describedby="exampleInputEmail" placeholder="登录名或邮箱" class="form-control rounded"><span aria-hidden="true" class="ti-user form-control-feedback"></span><span id="exampleInputEmail" class="sr-only">(default)</span>
        </div>
    </div>
    <div class="form-group has-feedback">
        <div class="col-xs-12">
            <input type="password" name="pass_word" aria-describedby="exampleInputPassword" placeholder="密码" class="form-control rounded"><span aria-hidden="true" class="ti-key form-control-feedback"></span><span id="exampleInputPassword" class="sr-only">(default)</span>
        </div>
    </div>
    <div class="form-group">
        <div class="col-xs-12">
            <div class="pull-left">
                <label class="checkbox-inline checkbox-custom">
                    <input id="exampleCheckboxRemember" type="checkbox" value="remember">
                    <label for="exampleCheckboxRemember">记住我</label>
                </label>
            </div>
            <div class="pull-right hidden"><a href="javascript:;" class="inline-block form-control-static">Forgot a Passowrd?</a></div>
        </div>
    </div>
    <button type="submit" id="loginBtn" class="btn btn-lg btn-success btn-raised btn-block">登 录</button>
</form>
<hr class="hidden">
<p class="text-muted hidden">第三方快速登录</p>
<div class="clearfix hidden">
    <div class="pull-left">
        <button type="button" class="btn btn-raised btn-primary"><i class="ti-wechat mr-5"></i> 微信登录</button>
    </div>
    <div class="pull-right">
        <button type="button" class="btn btn-raised btn-info"><i class="ti-twitter-alt mr-5"></i> Twitter</button>
    </div>
</div>
<hr class="hidden">
<div class="form-horizontal hidden">
    <div class="clearfix">
        <div class="pull-left">
            <p class="form-control-static">Want new account?</p>
        </div>
        <div class="pull-right"><a href="register.html" class="btn btn-outline btn-default">Sign Up</a></div>
    </div>
</div>
<script type="text/javascript" src="/static/admin/plugins/jquery/dist/jquery.min.js"></script>
<script>
    $(function () {
        $("#login").submit(function () {
            $.ajax({
                    url: '{:url('admin/index/login')}',
                type: 'post',
                dataType: 'json',
                data: $("#login").serialize(),
                success: function (data) {
                if(data.err){
                    alert(data.msg);
                    return false;
                }

                window.location.href = '{:url("admin/index/index")}';
            }
        });
            return false;
        });
    });
</script>
</body>
</html>